# 加入购物车
#
# 请求网址:http://182.92.81.159:8080/wx/cart/add
# 请求方法:POST
# 请求头：
# Content-Type: application/json;charset=utf-8
# X-Litemall-Token:TOKEN
# 请求体：
# {"goodsId":1181000,"number":1,"productId":2}
# 返回数据：

import requests


# resp1 = requests.post(url="http://192.168.119.137:8080/wx/auth/login",
#               headers={"Content-Type":"application/json;charset=utf-8"},
#               json={"username":"user123","password":"user123"})
#
# token = resp1.json()["data"]["token"]
#
# resp2 = requests.post(url="http://192.168.119.137:8080/wx/cart/add",
#                      headers={"Content-Type":"application/json;charset=UTF-8",
#                               "X-Litemall-Token":token},
#                      json={"goodsId":1181000,"number":1,"productId":2})
#
# print(resp2.json())

